Skip to content

Deploy cloud app to Cloudflare Workers - #119

Merged
RhysSullivan merged 2 commits into
mainfrom
deploy-cloud-to-cloudflare
Apr 8, 2026
Merged

Deploy cloud app to Cloudflare Workers#119
RhysSullivan merged 2 commits into
mainfrom
deploy-cloud-to-cloudflare

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Summary

  • Migrate cloud app from Node.js to Cloudflare Workers with Hyperdrive for Postgres
  • Add marketing worker service binding for route proxying (/, /home, /setup, /_astro)
  • Configure executor.sh custom domain with auth-aware routing
  • Fix HTTPS redirect URI in WorkOS auth flow
  • Remove 1Password plugin from cloud app

Changes

  • vite.config.ts — Replace SPA mode with @cloudflare/vite-plugin
  • wrangler.jsonc — New CF config with Hyperdrive, service binding, custom domain
  • start.ts — Marketing middleware proxies unauthenticated / and static assets to marketing worker
  • db.ts — Use Hyperdrive binding on CF, fall back to DATABASE_URL/PGlite locally. Migrations run out-of-band.
  • auth/handlers.ts — Use x-forwarded-proto header for correct HTTPS origin
  • env/index.ts — Guard Config.all({}) crash on empty shape

Test plan

  • Verify executor.sh serves marketing homepage when not signed in
  • Verify executor.sh redirects to dashboard when signed in
  • Verify /home, /setup always serve marketing
  • Verify /api/* routes work through cloud app
  • Verify WorkOS login/callback flow works with HTTPS

- Add @cloudflare/vite-plugin and wrangler, configure for CF Workers
- Add wrangler.jsonc with Hyperdrive binding and executor.sh custom domain
- Add service binding to marketing worker for route proxying
- Update vite.config.ts: replace SPA mode with Cloudflare plugin
- Update db.ts: use Hyperdrive binding, remove auto-migrations
- Update start.ts: add marketing middleware to proxy /, /home, /setup, /_astro
- Fix auth handler to use x-forwarded-proto for HTTPS redirect URIs
- Remove 1Password plugin from cloud app
- Add .env files to .gitignore
@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
executor-web Error Error Apr 8, 2026 11:42pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview April 8, 2026 23:42 Inactive
@RhysSullivan
RhysSullivan merged commit 2212916 into main Apr 8, 2026
RhysSullivan added a commit that referenced this pull request May 31, 2026
* Deploy cloud app to Cloudflare Workers

- Add @cloudflare/vite-plugin and wrangler, configure for CF Workers
- Add wrangler.jsonc with Hyperdrive binding and executor.sh custom domain
- Add service binding to marketing worker for route proxying
- Update vite.config.ts: replace SPA mode with Cloudflare plugin
- Update db.ts: use Hyperdrive binding, remove auto-migrations
- Update start.ts: add marketing middleware to proxy /, /home, /setup, /_astro
- Fix auth handler to use x-forwarded-proto for HTTPS redirect URIs
- Remove 1Password plugin from cloud app
- Add .env files to .gitignore

* Refactor db.ts to idiomatic Effect with scoped resources
@RhysSullivan
RhysSullivan deleted the deploy-cloud-to-cloudflare branch June 11, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant